Warning: mkdir(): No space left on device in /var/www/tg-me/post.php on line 37

Warning: file_put_contents(aCache/aDaily/post/csharp_ci/--): Failed to open stream: No such file or directory in /var/www/tg-me/post.php on line 50
C# (C Sharp) programming | Telegram Webview: csharp_ci/1386 -
Telegram Group & Telegram Channel
🚀 HybridCache

Это решение давней проблемы с разделением между IMemoryCache и IDistributedCache.

🔧 Что даёт HybridCache:
• Единый API для in-memory и distributed кэша
• Настраиваемая сериализация
• Stampede protection (анти-нагрузочная защита)
• Удаление по тегам

🧠 Как работает GetOrCreateAsync:
1. Проверяет локальный и распределённый кэш
2. Если нет — вызывает фабричный метод
3. Кэширует результат и возвращает его

🛡️ Stampede protection: только один запрос на ключ запускает фабрику, остальные ждут — никакой гонки или перегрузки БД.

📌 Сниппет на .NET 9 выглядит так:


app.MapGet("/products/{id}", async (
int id,
HybridCache cache,
ProductDbContext db,
CancellationToken ct) =>
{
var product = await cache.GetOrCreateAsync(
$"product-{id}",
async token =>
{
return await db.Products
.Include(p => p.Category)
.FirstOrDefaultAsync(p => p.Id == id, token);
},
cancellationToken: ct
);

return product is null ? Results.NotFound() : Results.Ok(product);
});


HybridCache доступен для ASP.NET Core

Все разработчики могут воспользоваться HybridCache для более эффективного управления кэшем в приложениях на ASP.NET Core.



tg-me.com/csharp_ci/1386
Create:
Last Update:

🚀 HybridCache

Это решение давней проблемы с разделением между IMemoryCache и IDistributedCache.

🔧 Что даёт HybridCache:
• Единый API для in-memory и distributed кэша
• Настраиваемая сериализация
• Stampede protection (анти-нагрузочная защита)
• Удаление по тегам

🧠 Как работает GetOrCreateAsync:
1. Проверяет локальный и распределённый кэш
2. Если нет — вызывает фабричный метод
3. Кэширует результат и возвращает его

🛡️ Stampede protection: только один запрос на ключ запускает фабрику, остальные ждут — никакой гонки или перегрузки БД.

📌 Сниппет на .NET 9 выглядит так:


app.MapGet("/products/{id}", async (
int id,
HybridCache cache,
ProductDbContext db,
CancellationToken ct) =>
{
var product = await cache.GetOrCreateAsync(
$"product-{id}",
async token =>
{
return await db.Products
.Include(p => p.Category)
.FirstOrDefaultAsync(p => p.Id == id, token);
},
cancellationToken: ct
);

return product is null ? Results.NotFound() : Results.Ok(product);
});


HybridCache доступен для ASP.NET Core

Все разработчики могут воспользоваться HybridCache для более эффективного управления кэшем в приложениях на ASP.NET Core.

BY C# (C Sharp) programming




Share with your friend now:
tg-me.com/csharp_ci/1386

View MORE
Open in Telegram


C C Sharp programming Telegram | DID YOU KNOW?

Date: |

Telegram and Signal Havens for Right-Wing Extremists

Since the violent storming of Capitol Hill and subsequent ban of former U.S. President Donald Trump from Facebook and Twitter, the removal of Parler from Amazon’s servers, and the de-platforming of incendiary right-wing content, messaging services Telegram and Signal have seen a deluge of new users. In January alone, Telegram reported 90 million new accounts. Its founder, Pavel Durov, described this as “the largest digital migration in human history.” Signal reportedly doubled its user base to 40 million people and became the most downloaded app in 70 countries. The two services rely on encryption to protect the privacy of user communication, which has made them popular with protesters seeking to conceal their identities against repressive governments in places like Belarus, Hong Kong, and Iran. But the same encryption technology has also made them a favored communication tool for criminals and terrorist groups, including al Qaeda and the Islamic State.

Dump Scam in Leaked Telegram Chat

A leaked Telegram discussion by 50 so-called crypto influencers has exposed the extraordinary steps they take in order to profit on the back off unsuspecting defi investors. According to a leaked screenshot of the chat, an elaborate plan to defraud defi investors using the worthless “$Few” tokens had been hatched. $Few tokens would be airdropped to some of the influencers who in turn promoted these to unsuspecting followers on Twitter.

C C Sharp programming from in


Telegram C# (C Sharp) programming
FROM USA